define([], function () {
    var app = angular.module('App');
    app.controller('metro.quickbarCtrl', ['$state', '$scope', 'Project', 'viewbag', 'quickbarHandler', function ($state, $scope, Project, viewbag, quickbarHandler) {
        
        /** 初始化project pane scroll */
        $('#page-quick-sidebar-wrapper').slimScroll({
            height: $('#page-quick-sidebar-wrapper').height()
        });


        $scope.curCity = viewbag.curCity;

        /** 接收城市变化的消息 */
        $scope.$on('curCityChange', function (event, data) {
            $scope.curCity = viewbag.curCity;
        });

        /** 处理line下面的project pane的下拉与关闭 */


        /** 跳转到prj */
        $scope.gotoPrj = function (prj) {
            viewbag.curPrj && (viewbag.curPrj.active = false);
            prj.active = true;
            viewbag.curPrj = prj;
            $state.go('metro.type.project', {
                type: viewbag.curType.typeCode,
                id: prj.prjId
            });
            quickbarHandler.close();
        };
    }]);
});